<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr1 = [1,3,5,7,9]
        let arr2 = [2,4,6,8,10]
        console.log(...arr1)
        let arr3 = [...arr1,...arr2] // 连接数组
        console.log(arr3) // [1,2,3,4,5,6,7,8,9,10]

        function sum (...numbers) {
            return numbers.reduce((preVal,currentVal)=>{
                return preVal+currentVal
            })
        }
        console.log(sum(1,2,3,4))

        let person = {
            name:'tom',
            age:18
        }
        let person2 = {...person} // 复制一个对象
        let person3 = {...person, name:'jack', address:'beijing'} // 复制对象的时候修改他的属性
    </script>
</body>
</html>